package trainfengxing.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import trainfengxing.mapper.HotelBookingMapper;
import trainfengxing.pojo.HotelBooking;
import trainfengxing.service.HotelBookingService;

import java.util.List;

@Service
public class HotelBookingServiceImpl implements HotelBookingService {
    @Autowired
    private HotelBookingMapper hotelBookingMapper;

    @Override
    public List<HotelBooking> getAllBookings() {
        return hotelBookingMapper.getAllBookings();
    }

    @Override
    public HotelBooking getBookingById(Integer bookingID) {
        return hotelBookingMapper.getBookingById(bookingID);
    }

    @Override
    public void addBooking(HotelBooking booking) {
        hotelBookingMapper.addBooking(booking);
    }

    @Override
    public void updateBooking(HotelBooking booking) {
        hotelBookingMapper.updateBooking(booking);
    }

    @Override
    public void deleteBooking(Integer bookingID) {
        hotelBookingMapper.deleteBooking(bookingID);
    }

    @Override
    public List<HotelBooking> getBookingsByUserId(Integer userID) {
        return hotelBookingMapper.getBookingsByUserId(userID);
    }
}